<#include "user_manager_header.ftl">

<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title">开放平台</h3>
	</div>
	<div class="panel-body">
		<ul class="nav nav-tabs">
			<li><a
				href="oilequipment_list?oilequipmentcode=${(oilequipment.oilEquipmentCode)?if_exists}">管理加油枪</a></li>
			<li class="active"><a href="oilequipment_update">增加加油枪</a></li>
		</ul>
		<div>
			<p></p>
		</div>

		<div class="panel panel-default">
			<div class="panel-body">

				<form class="form-horizontal" role="form" id="form" method="post"
					action="oilequipment_update_exe">

					<div class="form-group">
						<div class="col-sm-6">
							<input type="hidden" class="form-control"
								value="${readonly?if_exists}" name="readonly" id="readonly" />
						</div>
					</div>

					<div class="form-group">
						<label for="oilequipmentcode" class="col-sm-2 control-label">加油枪编码</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.oilEquipmentCode)?if_exists}"
								name="oilequipmentcode" id="oilequipmentcode" placeholder="加油枪编码"
								required />
						</div>
					</div>

					<div class="form-group">
						<label for="oilsitecode" class="col-sm-2 control-label">所属站点编码</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.oilSiteCode)?if_exists}"
								name="oilsitecode" id="oilsitecode" placeholder="所属站点编码"
								required />
						</div>
					</div>
					<div class="form-group">
						<label for="oilsitename" class="col-sm-2 control-label">所属站点名称</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.oilSiteName)?if_exists}"
								name="oilsitename" id="oilsitename" placeholder="所属站点名称"
								required />
						</div>
					</div>

					<div class="form-group">
						<label for="oilcharacter" class="col-sm-2 control-label">油品</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.oilCharacter)?if_exists}"
								name="oilcharacter" id="oilcharacter" placeholder="油品"
								required />
						</div>
					</div>

					<div class="form-group">
						<label for="discharge" class="col-sm-2 control-label">排放国际</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.discharge)?if_exists}"
								name="discharge" id="discharge" placeholder="排放国际"
								required />
						</div>
					</div>

					<div class="form-group">
						<label for="equipmentmemo" class="col-sm-2 control-label">设备备注</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.equipmentMemo)?if_exists}"
								name="equipmentmemo" id="equipmentmemo" placeholder="设备备注"
								required />
						</div>
					</div>

					<div class="form-group">
						<label for="qrurl" class="col-sm-2 control-label">设备二维码</label>
						<div class="col-sm-6">
							<input type="text" class="form-control"
								value="${(oilequipment.qrUrl)?if_exists}" name="qrurl" id="qrurl"
								placeholder="设备二维码" required />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">当前状态</label>
						<div class="col-sm-6">
							<select class="selectpicker" name="state" id="state" required>
								<option>请选择</option>
								<option value="0" selected="selected">正常</option>
								<option value="1">关闭</option>
								<option value="2">删除</option>
							</select>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-default" id="button"
								${(oilequipment.oilEquipmentCode)?if_exists}>提交</button>
						</div>
					</div>
				</form>

			</div>
			<!--/panel-body-->

		</div>
		<div class="panel-footer"></div>
	</div>

	<blockquote>
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
			Integer posuere erat a ante.</p>
		<footer>Luther</footer>
	</blockquote>

	<#include "user_manager_footer.ftl">

	<script type="text/javascript">
		$().ready(function() {
			$('.selectpicker').selectpicker();
			
			if (document.getElementById("readonly").value == "UPDATE") {
				document.getElementById("oilequipmentcode").readOnly = true;
				document.getElementById("oilsitecode").readOnly = true;
				document.getElementById("oilsitename").readOnly = true;
				document.getElementById("discharge").readOnly = true;
			}

			$("#button").click(function() {

			});

		});
	</script>